include $(TOPDIR)/rules.mk
PKG_VERSION:=1.5
PKG_RELEASE:=1
PKG_BUILD_FLAGS:=no-mips16
PKG_USE_MIPS16:=0
PKG_NAME:=dahuavto
GO_PKG:=$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
include $(TOPDIR)/feeds/packages/lang/golang/golang-package.mk

define Package/dahuavto
  SECTION:=utils
  CATEGORY:=Utilities
  TITLE:=Dahua VTO Protocol Simulator
  DEPENDS:=+libc
endef
define Package/dahuavto/description
  A Golang implementation of Dahua VTO protocol for door access control.
endef
define Package/dahuavto/install
	$(INSTALL_DIR) $(1)/usr/bin
	$(INSTALL_BIN) $(GO_PKG_BUILD_BIN_DIR)/dahuavto $(1)/usr/bin/
	$(INSTALL_DIR) $(1)/etc/init.d
	$(INSTALL_BIN) ./files/dahuavto.init $(1)/etc/init.d/dahuavto
	$(INSTALL_DIR) $(1)/etc/config
	$(INSTALL_CONF) ./files/dahuavto.conf $(1)/etc/config/dahuavto
	$(INSTALL_CONF) ./files/ui.html $(1)/etc/config/dahuavtoui
endef
$(eval $(call BuildPackage,dahuavto))